using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LogicSystemMgr : ILogicSystemMgr
{
    private HashSet<ILogicSystem> _logicSystems = new HashSet<ILogicSystem>();
    public void AddEntity(IEntity entity)
    {
        foreach(ILogicSystem logicSystem in _logicSystems)
        {
            logicSystem.AddEntity(entity);
        }
    }

    public void AddLogicSystem(ILogicSystem system)
    {
        _logicSystems.Add(system);
    }

    public void UpdateFun()
    {
        foreach (ILogicSystem logicSystem in _logicSystems)
        {
            logicSystem.Execute();
        }
    }
}
